Skip to main content
Feedback

Environment

Supported operations

OperationQUERYMUTATION
EventStreamsEnvironment✅ SupportedNot Supported 
EventStreamsRegion✅ SupportedNot Supported 
EventStreamsTokenNot Supported✅ Supported 

Environment query syntax

Environment query

query environment {
environments {
id
name
eventStreams {
region
subscriptionCount
topicCount
tokens {
id
name
data
allowConsume
allowProduce
expirationEditable
expirationTime
createdTime
createdBy
description
}
}
}
}

Environment query response

{
"data": {
"environments": [
{
"id": "XXXXX",
"name": "Production",
"eventStreams": {
"region": "usa-east-1",
"subscriptionCount": 4,
"topicCount": 3,
"tokens": [
{
"id": "XXXXXX",
"name": null,
"data": "XXXXXXX",
"allowConsume": true,
"allowProduce": true,
"expirationEditable": false,
"expirationTime": "2025-04-17T21:45:26.000Z",
"createdTime": "2024-04-17T21:45:26.000Z",
"createdBy": null,
"description": null
},
{
"id": "XXXXXX",
"name": "SAP",
"data": "XXXX",
"allowConsume": true,
"allowProduce": true,
"expirationEditable": true,
"expirationTime": "2024-12-01T07:59:59.000Z",
"createdTime": "2024-07-31T18:42:52.000Z",
"createdBy": null,
"description": null
}
]
}
}
]
}
}

Environment query fields

EventStreamsEnvironment

FieldTypeDescription
regionstringThe region name of the Event Streams cluster for this environment.
topicCountIntegerThe number of topics in this environment.
topicsEventStreamsTopicThe list of topics in this environment.
subscriptionCountIntegerThe current number of subscriptions on all topics in this environment.
backlogCountBigIntegerThe current number of messages not acknowledged on this subscription.
producerCountIntegerThe current number of producers on all topics in this environment.
tokensEventStreamsTokenAll the tokens can be used to connect to this environment on pulsar

Tokens

FieldTypeDescription
IdIDUnique identifier associated with a token.
namestringThe name of a token chosen by the user during creation. The name would be set to 'default', the default value when the token is auto-created for an environment.
datastringThe actual JWT token associated with the object.
allowConsumeBooleanDetermines if consume action permission was granted to the token or not.
allowProduceBooleanDetermines if produce action permission was granted to the token or not.
expirationEditableBooleanSignifies if the expiration time of the token can be extended without having to recreate a token. The legacy tokens will have this set to false since the token carries the expiration as a claim within itself.
expirationTimeDateTimeTimestamp by which a token would expire.365 days from the creation date if not specified.
createdTimeDateTimeTimestamp of when the token was created.
createdByStringThe user who created the token.
descriptionStringThe description associated with a token.

EventStreamsProducer

FieldTypeDescription
nameStringThe name of the producer.
messageRateInFloatThe current rate of messages published per second by this producer.
createdTimeDateTimeThe timestamp when this producer was created either through this api or when the producer published a message.

EventStreamsConsumer

FieldTypeDescription
nameStringThe name of the consumer.
messageRateOutFloatThe current rate of messages delivered per second to the consumer.

EventStreamsAccount

FieldTypeDescription
provisionedBooleanWhether the account is provisioned for Event Streams or not.
type Account @key(fields: "id") @extends {
id: ID!
" Event Streams information about this Account"
eventStreams: EventStreamsAccount! @hasFeature(features: [["EVENT_STREAMS"]]) @hasPrivilege(privs: [["EVENT_STREAMS_ACCESS", "EVENT_STREAMS_ADMIN"]])
}

EventStreamsTopicKey

FieldTypeDescription
environmentIdIDThe ID of the environment to which the topic belongs.
nameIDThe current rate of messages delivered per second to the consumer.

EventStreamsSubscriptionKey

FieldTypeDescription
topicEventStreamsTopicKeyThe topic the subscription is on.
nameIDThe subscription name.

Region query syntax

Retrieves all of the available regions.

eventStreamsRegions: Account!

EventStreamsRegion query

query region{
eventStreamsRegions {
id
}
}

EventStreamsRegion response

{
"data": {
"eventStreamsRegions": [
{
"id": "aus-1"
},
{
"id": "usa-east-1"
}
]
}
}

Token Mutation syntax

eventStreamsTokenCreate ( input EventStreamsEnvironmentTokenCreateInput! ) [EventStreamsToken]

eventStreamsTokenUpdate ( input EventStreamsEnvironmentTokenUpdateInput! ) [EventStreamsToken]

eventStreamsTokenDelete ( input ID! ) [ID]

Token Mutation Input fields

EventStreamsEnvironmentTokenCreateInput

FieldTypeDescription
environmentIDThe environment to which the token belongs.
nameStringThe name to be associated with the token. This need to be unique within the environment.
allowConsumeBooleanDetermines whether or not the consume action permission is to be granted to the token.
allowProduceBooleanDetermines whether or not the produce action permission is to be granted to the token.
expirationTimeDateTimeTimestamp for when a token is to expire. If not specified, the default is 365 days.
descriptionStringDescription of the token.

EventStreamsEnvironmentTokenUpdateInput

FieldTypeDescription
idIDUnique identifier of the token.
nameStringThe name to be associated with the token. This need to be unique within the environment.
allowConsumeBooleanDetermines whether or not the consume action permission is to be granted to the token.
allowProduceBooleanDetermines whether or not the produce action permission is to be granted to the token.
expirationTimeDateTimeTimestamp for when a token is to expire. If not specified, the default is 365 days.
descriptionStringDescription of the token.

Implementation

CREATE

EventStreamsToken Request

mutation createToken{
eventStreamsTokenCreate(input: {
environmentId:"XXXXX"
name: "-----"
allowConsume: true
allowProduce: true
description: "api test"
expirationTime: "2025-05-09T23:59:59-04:00"
}) {
id
name
data
allowConsume
allowProduce
expirationEditable
expirationTime
createdTime
createdBy
description
}
}

EventStreamsToken Response

{
"data": {
"eventStreamsTokenCreate": {
"id": "XXXX",
"name": "----",
"data": "XXXXXX",
"allowConsume": true,
"allowProduce": true,
"expirationEditable": true,
"expirationTime": "2025-05-10T03:59:59.000Z",
"createdTime": "2024-05-31T17:38:51.991Z",
"createdBy": null,
"description": "api test"
}
}
}

UPDATE

EventStreamsToken Request

mutation updateToken{
eventStreamsTokenUpdate(input: {
"id": "XXXX",
"name": "----"
allowConsume: true
allowProduce: false
expirationTime: "2025-05-09T23:59:59-04:00"
description: "api test update"
}){
id
name
data
allowConsume
allowProduce
expirationEditable
expirationTime
createdTime
createdBy
description
}
}

EventStreamsToken Response

{
"data": {
"eventStreamsTokenCreate": {
"id": "XXXX",
"name": "----",
"data": "XXXXXX",
"allowConsume": true,
"allowProduce": false,
"expirationEditable": true,
"expirationTime": "2025-05-10T03:59:59.000Z",
"createdTime": "2024-05-31T17:38:51.991Z",
"createdBy": null,
"description": "api test update"
}
}
}

DELETE

EventStreamsToken Request

mutation deleteToken{
eventStreamsTokenDelete(id:"XXXX")}

EventStreamsToken Response

{
"data": {
"eventStreamsTokenDelete": "tok-XXXX"
}
}
On this Page